//
//  ViewController.swift
//  MCComponentExtension
//
//  Created by 562863544@qq.com on 11/30/2018.
//  Copyright (c) 2018 562863544@qq.com. All rights reserved.
//

import UIKit
//import SnapKit

import MCComponentPublicUI
import MCComponentExtension

class ViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        
        let timeStr = "20191203151801"
                
        let time = timeStr.mc_toTimeStr(originFormat: "yyyyMMddHHmmss", toFormat: "yyyy-MM-dd HH:mm")
        print(time)

        let aaa = time.mc_toWisdomTime("yyyyMMddHHmmss")
        print(aaa)

//        title = "示例"
//
//        view.addSubview(tableView)
//        tableView.snp.remakeConstraints { (make) ->Void in
//            make.left.right.top.bottom.equalTo(view)
//        }
//
//
//        dataArrayM = [
//            "富文本使用",
//        ]
    }
    
    
    
    lazy var tableView = MCTableView.mc_make(registerCell: UITableViewCell.self, delegate: self)
    
    lazy var dataArrayM: [String] = []
}

extension ViewController: UITableViewDelegate, UITableViewDataSource {
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return dataArrayM.count
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell: UITableViewCell = tableView.mc_makeCell(indexPath: indexPath)
        
        cell.textLabel?.text = dataArrayM[indexPath.row]
        
        return cell
    }
    
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        
        let titleStr = dataArrayM[indexPath.row]
        
        switch titleStr {
        case "富文本使用":
            let vc = MCMutableAttributedStringViewController()
            navigationController?.pushViewController(vc, animated: true)
        default:
            break
        }
        
        
    }
}
